/**
 * @author baz
 */
package lib {
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Point;

public class GridView extends Sprite {
    public function GridView() {
        graphics.lineStyle(1, 0x999999, 0.85);
        for (var i:int = 1; i < 20; i++) {
            graphics.moveTo(i * 10, 0);
            graphics.lineTo(i * 10, 5);
            graphics.moveTo(0, i * 10);
            graphics.lineTo(5, i * 10);
        }
    }

    public function setDot(dot:Point, color:uint = 0xFF0000):Shape {
        var dotView:Shape = new Shape();
        dotView.graphics.lineStyle(1.2, color, 0.85);
        dotView.graphics.beginFill(0x999999, 0.85);
        dotView.graphics.drawCircle(0, 0, 3);
        addChild(dotView)
        dotView.x = dot.x;
        dotView.y = dot.y;
        return dotView;
    }

    private function getDotView():Shape {
        var dotView:Shape = new Shape();
        dotView.graphics.lineStyle(1.2, 0xFF0000, 0.85);
        dotView.graphics.beginFill(0x999999, 0.85);
        dotView.graphics.drawCircle(0, 0, 3);
        return dotView;
    }
}
}
